<template>
    <div class="container-content detail">
        <div class="detail-container">
            <el-row>
                <el-col :span="24">
                    <h3 class="panel-title"></h3>
                </el-col>
            </el-row>
            <el-descriptions
                class="detail-descriptions"
                title="投标详情"
                :column="1"
                border
                colon
            >
                <el-descriptions-item>
                    <template slot="label"> 投标客户名称 </template>
                    {{ formObject.customerName || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 投标项目概况 </template>
                    {{ formObject.number || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 项目简介 </template>
                    {{ formObject.signUserId || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 投标时间 </template>
                    {{ formObject.tenderTime || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 开标日期 </template>
                    {{ formObject.bidOpenTime || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 购买标书时间 </template>
                    {{ formObject.buyBidTime || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 保证金退还日期 </template>
                    {{ formObject.ensureBackTime || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 保证金金额 </template>
                    {{ formObject.ensureMoney || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 竞争对手 </template>
                    {{ formObject.competitors || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">招标项目资金来源 </template>
                    <el-tag v-if="formObject.type == 1">自筹</el-tag>
                    <el-tag v-else-if="formObject.type == 2">财政拨款</el-tag>
                    <el-tag v-else-if="formObject.type == 3">政府补贴</el-tag>
                    <el-tag v-else-if="formObject.type == 4">其他</el-tag>
                    <span v-else>--</span>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">招标方式 </template>
                    <el-tag v-if="formObject.tenderingType == 1">入库</el-tag>
                    <el-tag v-else-if="formObject.tenderingType == 2"
                        >出库</el-tag
                    >
                    <el-tag v-else-if="formObject.tenderingType == 3"
                        >仪标</el-tag
                    >
                    <span v-else>--</span>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label">有无内部资源 </template>
                    <el-tag v-if="formObject.isInsideResource == 1">有</el-tag>
                    <el-tag v-else-if="formObject.isInsideResource == 2"
                        >无</el-tag
                    >
                    <span v-else>--</span>
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 创建时间 </template>
                    {{ formObject.createTime || "--" }}
                </el-descriptions-item>
                <el-descriptions-item>
                    <template slot="label"> 更新时间 </template>
                    {{ formObject.changeTime || "--" }}
                </el-descriptions-item>
            </el-descriptions>
        </div>
    </div>
</template>
<script>
import { getDetailTenderList, deleteTender } from "@/api/system/tender";
export default {
    props:['rowId'],
    data() {
        return {
            formObject: {
                bidOpenTime: "",
                buyBidTime: "",
                capitalSource: "",
                changeTime: "",
                competitors: "",
                createTime: "",
                customerId: "",
                customerName: "",
                ensureBackTime: "",
                ensureMoney: "",
                id: "",
                isEnsure: 0,
                isInsideResource: "",
                projectDesc: "",
                projectOverview: "",
                tenderTime: "",
                tenderingType: 0,
            },
        };
    },
    methods: {
        getData(id) {
            getDetailTenderList(id).then((res) => {
                if (res.code === 200) {
                    let data = res.data;
                    Object.keys(this.formObject).forEach((key) => {
                        this.formObject[key] = data[key];
                    });
                }
            });
        },
    },
    created() {
        this.getData(this.rowId);
    },
};
</script>
<style lang="scss" scoped>
.detail-bg {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    height: 200px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-left: 10px;
    padding-right: 10px;
}
.detail {
    background: #f1f4f5;
    height: 100%;
}
.detail-container {
    width: 98%;
    margin: 1%;
    background: #fff;
    z-index: 3;
    position: relative;
    border-radius: 10px;
    padding: 20px;
}
.detail-descriptions {
    padding-left: 40px;
    padding-right: 40px;
}
::v-deep .el-descriptions-item__label.is-bordered-label {
    width: 20%;
}
</style>
